package com.higgins.eventtracking.server.dataModel;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.higgins.eventtracking.client.dto.HealthAlertDTO;
import com.higgins.eventtracking.client.dto.HealthEventDTO;
import com.higgins.eventtracking.client.dto.TimeTableTaskDTO;

@PersistenceCapable
public class TimeTableTask {
	@SuppressWarnings("unused")
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
		
	@Persistent
	private String task;
	
	@Persistent
	private String task2;
	
	@Persistent
	private String task3;

	@Persistent
	private String task4;

	@Persistent
	private String fuel;

	@Persistent
	private Integer year;
	
	@Persistent
	private Integer month;

    @Persistent
    private Integer monthYear;
	
	@Persistent
	private Integer week;

    @Persistent
    private Integer weekYear;
	
	@Persistent
	private Integer dayOfYear;
	
	@Persistent
	private Integer dayFraction;
	
	@Persistent
	private Integer hour;
	
	@Persistent
	private Date date;
	
	@Persistent
	private Integer holidayUnit;
	
	@Persistent
	private Date holidayDate;

	
	public TimeTableTask()	{

	}
	public TimeTableTask(TimeTableTaskDTO dto)	{
		this.task = dto.getTask();
		this.task2 = dto.getTask2();
		this.task3 = dto.getTask3();
		this.task4 = dto.getTask4();
		this.fuel = dto.getFuel();
		this.year = dto.getYear();
		this.month = dto.getMonth();
		this.monthYear = dto.getMonthYear();
		this.week = dto.getWeek();
		this.weekYear = dto.getWeekYear();
		this.dayOfYear = dto.getDayOfYear();
		this.dayFraction = dto.getDayFraction();
		this.hour = dto.getHour();
		this.date = dto.getDate();
		this.holidayUnit = dto.getHolidayUnit();
		this.holidayDate = dto.getHolidayDate();
	}
	public Long getId()	{
		return id;
	}
	public void setTask(String task)	{
		this.task = task;
	}
	public String getTask()	{
		return task;
	}
	public void setTask2(String task2)	{
		this.task2 = task2;
	}
	public String getTask2()	{
		return task2;
	}
	public void setTask3(String task3)	{
		this.task3 = task3;
	}
	public String getTask3()	{
		return task3;
	}
	public void setTask4(String task4)	{
		this.task4 = task4;
	}
	public String getTask4()	{
		return task4;
	}
	public void setFuel(String fuel)	{
		this.fuel = fuel;
	}
	public String getFuel()	{
		return fuel;
	}
	public void setYear(Integer year)	{
		this.year = year;
	}
	public Integer getYear()	{
		return year;
	}
	public void setMonth(Integer month)	{
		this.month = month;
	}
	public Integer getMonth()	{
		return month;
	}
    public void setMonthYear(Integer monthYear)    {
        this.monthYear = monthYear;
    }
    public Integer getMonthYear()  {
        return monthYear;
    }
	public void setWeek(Integer week)	{
		this.week = week;
	}
	public Integer getWeek()	{
		return week;
	}
    public void setWeekYear(Integer weekYear)  {
        this.weekYear = weekYear;
    }
    public Integer getWeekYear()   {
        return weekYear;
    }
	public void setDayOfYear(Integer dayOfYear)	{
		this.dayOfYear = dayOfYear;
	}
	public Integer getDayOfYear()	{
		return dayOfYear;
	}
	public void setDayFraction(Integer dayFraction)	{
		this.dayFraction = dayFraction;
	}
	public Integer getDayFraction()	{
		return dayFraction;
	}
	public void setHour(Integer hour)	{
		this.hour = hour;
	}
	public Integer getHour()	{
		return hour;
	}
	public void setDate(Date date)	{
		this.date = date;
	}
	public Date getDate()	{
		return date;
	}
	public void setHolidayUnit(Integer holidayUnit)	{
		this.holidayUnit = holidayUnit;
	}
	public Integer getHolidayUnit()	{
		return holidayUnit;
	}
	public void setHolidayDate(Date holidayDate)	{
		this.holidayDate = holidayDate;
	}
	public Date getHolidayDate()	{
		return holidayDate;
	}

	public TimeTableTaskDTO toDTO()	{
		TimeTableTaskDTO dto = new TimeTableTaskDTO(id, task, task2, task3, task4, fuel, year, month, monthYear, week, weekYear, dayOfYear, dayFraction, hour, holidayUnit, holidayDate, date);
		return dto;
	}
	public void update(TimeTableTaskDTO dto)	{
		this.id = dto.getId();
		this.task = dto.getTask();
		this.task2 = dto.getTask2();
		this.task3 = dto.getTask3();
		this.task4 = dto.getTask4();
		this.fuel = dto.getFuel();
		this.year = dto.getYear();
		this.month = dto.getMonth();
		this.monthYear = dto.getMonthYear();
		this.week = dto.getWeek();
		this.weekYear = dto.getWeekYear();
		this.dayOfYear = dto.getDayOfYear();
		this.dayFraction = dto.getDayFraction();
		this.hour = dto.getHour();
		this.date = dto.getDate();
		this.holidayUnit = dto.getHolidayUnit();
		this.holidayDate = dto.getHolidayDate();
	}
}
